package com.diver.flinkdemo.entity.xxt.zgyzh;
/**
 * @Author liuC
 * @Date 2022/8/11 0011 10:56
 * @Describe 紫光翼智慧result
 */
public class ZgyzhResult {
    public static<W> ZgyzhResultVo getSuccessVo(W data){
        ZgyzhResultVo<W> vo = new ZgyzhResultVo();
        vo.setData(data);
        return vo;
    }

    public static<W> ZgyzhResultVo getSuccessVo(String msg,W data){
        ZgyzhResultVo<W> vo = new ZgyzhResultVo();
        vo.setData(data);
        vo.setMessage(msg);
        return vo;
    }

    public static ZgyzhResultVo getSuccessVo(){
        return getSuccessVo(null);
    }

    public static ZgyzhResultVo getErrorVo(ZgyzhStatusCode statusCode){
        ZgyzhResultVo vo = new ZgyzhResultVo();
        vo.setCode(statusCode.getCode());
        vo.setMessage(statusCode.getMessage());
        return vo;
    }

    public  static ZgyzhResultVo getErrorVo(ZgyzhStatusCode statusCode, String msg){
        ZgyzhResultVo vo = new ZgyzhResultVo();
        vo.setCode(statusCode.getCode());
        vo.setMessage(msg);
        return vo;
    }
}
